<template>
  <div class="game">
    <!-- <div class="game-menu">
      <div v-for="(x, y) in gameMenus" :key="y" @click="selectGame(y)" :class="y == gameIdx ? 'active' : ''">
        {{ x }}
      </div>
    </div>
    <div class="game-content">
      <Diff v-if="gameIdx == 0" />
      <Bottle v-if="gameIdx == 1" />
    </div>
    -->
    <el-segmented v-model="value" :options="gameMenus" size="large" />
    <div class="game-content">
      <Diff v-if="value == '找不同'" />
      <Bottle v-if="value == '放瓶子'" />
    </div>
  </div>
</template>

<script setup>
// document.title = '小游戏'
import Diff from './modules/Diff.vue';
import Bottle from './modules/bottle.vue';
import { ref } from 'vue'
const gameIdx = ref(0)
const value = ref('找不同')
const gameMenus = [
  '找不同', '放瓶子', '数独', '华容道', '德州扑克', '贪吃蛇'
]
function selectGame(y) {
  gameIdx.value = y
}

</script>

<style scoped lang="scss">
.game {
  margin: 10px;

  .game-menu {
    display: flex;

    >div {
      width: 120px;
      height: 60px;
      line-height: 60px;
      margin-right: 20px;
      cursor: pointer;
    }

    .active {
      color: red;
    }
  }
}
</style>
